package pe.gob.mpfn.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pe.gob.mpfn.model.Expediente;


@Service
@Transactional
public class ExpedienteServiceImpl implements ExpedienteService {

	public long countAllExpedientes() {
        return Expediente.countExpedientes();
    }

	public void deleteExpediente(Expediente expediente) {
        expediente.remove();
    }

	public Expediente findExpediente(String id) {
        return Expediente.findExpediente(id);
    }

	public List<Expediente> findAllExpedientes() {
        return Expediente.findAllExpedientes();
    }

	public List<Expediente> findExpedienteEntries(int firstResult, int maxResults) {
        return Expediente.findExpedienteEntries(firstResult, maxResults);
    }

	public void saveExpediente(Expediente expediente) {
        expediente.persist();
    }

	public Expediente updateExpediente(Expediente expediente) {
        return expediente.merge();
    }
}
